import api from '../../utils/api';

Page({

  data: {
    articleList: []
  },

  onLoad: function (options) {
    this.getArticleList();
  },

  getArticleList() {
    const _this = this;
    wx.showLoading({
      title: '请稍后...'
    });
    api({
      url: '/User/queryArticleList',
      method: 'GET',
      success: function (res) {
        wx.hideLoading();
        _this.setData({
          articleList: res.data.data
        });
      }
    });
  },

  toDatil(e) {
    const { item } = e.currentTarget.dataset;
    wx.navigateTo({
      url: '../xiangxiwenzhang/xiangxiwenzhang?id=' + item.id + '&title=' + item.title,
    });
  }
})